package com.ieheima.zuoye7;

import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException, InterruptedException {
        long start = System.currentTimeMillis();
        Thread thread = new Thread(() -> {

        try (
           BufferedReader br = new BufferedReader(new FileReader("D:\\java-base-ws\\JavaAdvanceProject\\day20_kaoshi\\src\\com\\ieheima\\zuoye7\\a.txt"));
           BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\java-base-ws\\JavaAdvanceProject\\day20_kaoshi\\src\\com\\ieheima\\zuoye7\\b.txt"));
                ){
           String line;
           while ((line = br.readLine()) != null) {
               bw.write(line);
               bw.newLine();
               bw.flush();
           }
            System.out.println("复制完毕！");

        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        });
        thread.start();
        thread.join();
        long end = System.currentTimeMillis();
        System.out.println("耗时：" + (end - start) + "毫秒");

    }
}
